package com.ycfmedical.bed.present;

import com.ycfmedical.bed.local.DataManager;
import com.ycfmedical.bed.local.entity.HisNurseRecordsMsg;
import com.ycfmedical.bed.local.entity.User;
import com.ycfmedical.bed.ui.fragment.HisNursedRecordsFragment;

import java.util.ArrayList;
import java.util.List;

import cn.droidlover.xdroidmvp.mvp.XPresent;

/**
 * Created by Administrator on 2017-05-01.
 */

public class HisNursedRecordsPresenter extends XPresent<HisNursedRecordsFragment>{
    public void loadData( ){
        User use= DataManager.getInstance().getUser();
        List<HisNurseRecordsMsg> hisNurseRecordsMsg=new ArrayList<>();
        if(null!=use){
            hisNurseRecordsMsg.add( addMsg(use,"2017年3月11日"));
            hisNurseRecordsMsg.add( addMsg(use,"2017年3月12日"));
            hisNurseRecordsMsg.add( addMsg(use,"2017年3月13日"));
        }
    getV().showData(hisNurseRecordsMsg);

    }

    private HisNurseRecordsMsg addMsg( User use, String date) {
        HisNurseRecordsMsg hisnurseRecords=new HisNurseRecordsMsg();
        hisnurseRecords.setBedId(use.getBedId());
        hisnurseRecords.setUserId(use.getId());
        hisnurseRecords.setNurseRecordsDate(date);
        hisnurseRecords.setNurseRecordsDetail(use.getNurseName()+"在"+date+"对"+use.getName()+"做了基本护理；");
        return hisnurseRecords;
    }
}
